From: Florian Müllner Date: Wed, 18 Dec 2019 23:45:17 +0000 (+0100) Subject: dateMenu: Tweak temperature labels X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~235 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=57751a2bef85dc0e3f5fdefacf35fa2b4158a5c7;p=gnome-shell.git dateMenu: Tweak temperature labels Together with the forecast icon, the temperature label is the most important information in the weather section. To emphasize it more, reduce its space requirement by removing the temperature unit, then make the text bold. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1143 --- diff --git a/data/theme/gnome-shell-sass/widgets/_calendar.scss b/data/theme/gnome-shell-sass/widgets/_calendar.scss index 0c7c5fd24..fcd4448ad 100644 --- a/data/theme/gnome-shell-sass/widgets/_calendar.scss +++ b/data/theme/gnome-shell-sass/widgets/_calendar.scss @@ -222,6 +222,10 @@ icon-size: $base_icon_size * 2; } + .weather-forecast-temp { + font-weight: bold; + } + .weather-forecast-time { color: darken($fg_color,30%); font-feature-settings: "tnum"; diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index af0984697..e7d3c47b2 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -348,6 +348,8 @@ class WeatherSection extends St.Button { timeOnly: true, ampm: false, }); + const [, tempValue] = fc.get_value_temp(GWeather.TemperatureUnit.DEFAULT); + const tempPrefix = tempValue >= 0 ? ' ' : ''; let icon = new St.Icon({ style_class: 'weather-forecast-icon', @@ -357,7 +359,7 @@ class WeatherSection extends St.Button { }); let temp = new St.Label({ style_class: 'weather-forecast-temp', - text: fc.get_temp_summary(), + text: '%s%.0f°'.format(tempPrefix, tempValue), x_align: Clutter.ActorAlign.CENTER, }); let time = new St.Label({